01General principles
Computers communicate using the TCP/IP protocols, which use 32-bit addresses. An address is written as 4 numbers from 0 to 255 (4 × 8 bits), in the form xxx.xxx.xxx.xxx, where each xxx is an integer from 0 to 255.
02Address structure
An IP address is made of two distinct parts. Two computers on the same network can't have the same IP address.
Net-ID (network ID)
The left part: designates the network.
Host-ID (machine ID)
The right part: designates the machines on that network.
03Special IP addresses
Network address
Host-ID made only of 0s: the address represents the network itself.
Broadcast address
Host-ID made only of 1s: the address reaches ALL machines on the network.
Localhost
127.0.0.1 designates the local machine. Used to test the network card.
04Address classes
IP addresses are divided into classes according to the number of bytes used for the network. The first bits determine the class.
| Class | Net-ID size | First bits | Default mask |
|---|---|---|---|
A | 8 bits (1 byte) | 0 | 255.0.0.0 |
B | 16 bits (2 bytes) | 10 | 255.255.0.0 |
C | 24 bits (3 bytes) | 110 | 255.255.255.0 |
Network capacities
| Class | Number of possible networks | Max computers per network |
|---|---|---|
A | 126 | 16,777,214 |
B | 16,384 | 65,534 |
C | 2,097,152 | 254 |
05CIDR notation
Instead of dotted decimal masks (e.g. 255.255.0.0), CIDR (Classless Inter-Domain Routing) notation gives the number of bits used for the Net-ID.
Format
/number of bits
Example
255.255.0.0 → /16
Example
255.255.255.192 → /26
06Private IP addresses (RFC 1918)
| Class | Min usable IP | Max usable IP | Subnet mask |
|---|---|---|---|
A | 10.0.0.1 | 10.255.255.254 | 255.0.0.0 |
B | 172.16.0.1 | 172.31.255.254 | 255.255.0.0 |
C | 192.168.0.1 | 192.168.255.254 | 255.255.255.0 |